<?php if (!defined('THINK_PATH')) exit(); /*a:5:{s:109:"D:\phpstudy_pro\WWW\qdcrmceshi.com\public/../application/admin\view\qingdongams\customer\contract\detail.html";i:1751938036;s:77:"D:\phpstudy_pro\WWW\qdcrmceshi.com\application\admin\view\layout\default.html";i:1746006160;s:74:"D:\phpstudy_pro\WWW\qdcrmceshi.com\application\admin\view\common\meta.html";i:1746006160;s:93:"D:\phpstudy_pro\WWW\qdcrmceshi.com\application\admin\view\qingdongams\common\form_detail.html";i:1751938036;s:76:"D:\phpstudy_pro\WWW\qdcrmceshi.com\application\admin\view\common\script.html";i:1746006160;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
<title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">
<meta name="referrer" content="never">
<meta name="robots" content="noindex, nofollow">

<link rel="shortcut icon" href="/assets/img/favicon.ico" />
<!-- Loading Bootstrap -->
<link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo htmlentities(\think\Config::get('site.version') ?? ''); ?>" rel="stylesheet">

<?php if(\think\Config::get('fastadmin.adminskin')): ?>
<link href="/assets/css/skins/<?php echo htmlentities(\think\Config::get('fastadmin.adminskin') ?? ''); ?>.css?v=<?php echo htmlentities(\think\Config::get('site.version') ?? ''); ?>" rel="stylesheet">
<?php endif; ?>

<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
  <script src="/assets/js/html5shiv.js"></script>
  <script src="/assets/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
    var require = {
        config:  <?php echo json_encode($config ?? ''); ?>
    };
</script>

    </head>

    <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
        <div id="main" role="main">
            <div class="tab-content tab-addtabs">
                <div id="content">
                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <section class="content-header hide">
                                <h1>
                                    <?php echo __('Dashboard'); ?>
                                    <small><?php echo __('Control panel'); ?></small>
                                </h1>
                            </section>
                            <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
                            <!-- RIBBON -->
                            <div id="ribbon">
                                <ol class="breadcrumb pull-left">
                                    <?php if($auth->check('dashboard')): ?>
                                    <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
                                    <?php endif; ?>
                                </ol>
                                <ol class="breadcrumb pull-right">
                                    <?php foreach($breadcrumb as $vo): ?>
                                    <li><a href="javascript:;" data-url="<?php echo htmlentities($vo['url'] ?? ''); ?>"><?php echo htmlentities($vo['title'] ?? ''); ?></a></li>
                                    <?php endforeach; ?>
                                </ol>
                            </div>
                            <!-- END RIBBON -->
                            <?php endif; ?>
                            <div class="content">
                                <link href="/assets/addons/qingdongams/css/common.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">

<style type="text/css">
    .btn-list {
        position: fixed;
        right: 40px;
    }
    .div-flex {
        display: flex
    }
    .div-flex .form-group {
        margin-right: 50px;
        text-align: center;
        line-height: 25px;
        margin-bottom: 0;
    }
    .tab-pane {
        border: 1px solid #F6F6F6;
    }
    .i-color {
        font-size: 34px;margin-right: 10px;color: #86C3FF;
    }
    .thumbnail {
        display: flow-root;
        width: max-content;
    }
    .thumbnail img {
        width: 50px;
        float: left;
        padding: 5px;
    }
    .text-color{
        color:#777;
    }
</style>
<style type="text/css">
    .examine_title{
        font-size: 14px;
        color: #333;
        -webkit-box-flex: 1;
        -ms-flex: 1;
        flex: 1;
        display: block;
        height: 30px;
    }
    .examine_box{
        padding-left:20px;
        position: relative;
    }
    .examine_box .newicon{
        position: absolute;
        left:0;
        top:0;
        z-index: 2;
    }
    .examine_box .xian{
        width:1px;
        height:100%;
        background:#e6e6e6;
        position: absolute;
        left:4px;
        top:10px;
        z-index: 1;
    }
    .examine_box .examine_bg{
        position: relative;
        margin-top: 15px;
        border-radius: 4px;
        background-color: #f7f8fa;
        font-size: 12px;
        color: #929293;
        padding: 8px;
        line-height: 18px;
    }
    .rowbox{
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }
    .stafflist{
        width: 70px;text-align: center;float: left;
    }
    .stafflist-right{
        width: 30px;text-align: center;float: left;margin: 0 20px;

    }
    .stafflist-right:last-child{
        display: none;
    }
    .stafflist img{
        width: 40px;
        height: 40px;
        margin: 10px;
        border-radius:50%;
    }
</style>

<div class="panel panel-default panel-intro">
    <input type="hidden" name="ids" id="ids" value="<?php echo $ids; ?>"/>
    <div class="div-flex">
        <i class="fa fa-address-card i-color"></i>
        <div style="line-height: 35px"><b><?php echo $row['name']; ?></b>      <?php switch($row['check_status']): case "0": ?><b class="text-success">(审核中)</b><?php break; case "1": ?><b class="text-success">(审核中)</b><?php break; case "2": ?><b class="text-warning">(审核通过)</b><?php break; case "3": ?><b class="text-danger">(审核拒绝)</b><?php break; case "4": ?><b class="text-danger">(撤销审批)</b><?php break; default: endswitch; ?></div>
        <div class="btn-list">
            <?php if(isset($flow) && $flow): if($flow['is_check'] == '1'): ?>
            <a class="btn btn-success btn-dialog" data-area="" data-shade="0.3"
               data-url="qingdongams/examine/examine_record/examine?relation_type=contract&relation_id=<?php echo $ids; ?>&status=1"
               data-title="审核通过" >审核通过</a>
            <a class="btn btn-danger btn-dialog" data-area="" data-shade="0.3"
               data-url="qingdongams/examine/examine_record/examine?relation_type=contract&relation_id=<?php echo $ids; ?>&status=2"
               data-title="审核拒绝" >审核拒绝</a>
            <?php endif; endif; if(($row['check_status'] == 3) OR ($row['check_status'] == 4)): ?>
            <a class="btn btn-success" data-toggle="dropdown" id="edits">编辑</a>
            <?php endif; if($row['check_status'] == 2): ?>
            <a class="btn btn-success btn-address" data-id="<?php echo $ids; ?>"
               data-types="contract" data-title="收货地址">填写收货地址</a>
            <a class="btn btn-success btn-logistics" data-id="<?php echo $ids; ?>"
               data-types="contract" data-title="发票物流">填写发票物流</a>
            <a class="btn btn-success btn-receipt" data-id="<?php echo $ids; ?>"
               data-types="contract" data-title="发票回执单">填写发票回执单</a>
            <?php endif; ?>
            <a href="javascript:void(0)"
               class="btn btn-success btn-word" data-id="<?php echo $ids; ?>"
               data-types="contract" data-title="下载合同">下载合同</a>
            <?php if($row['contract_status'] != 2): ?>
            <a class="btn btn-info btn-danger btn-stop" data-toggle="dropdown">终止合同</a>
            <?php endif; ?>


        </div>
        <input type="hidden" value="<?php echo $row['id']; ?>" id="contractId">
    </div>

    <div style="margin-top: 10px">
    </div>
    <?php if(isset($flow) && $flow): if($flow['status'] == 1): ?>

    <div class="div-flex">
        <div class="form-group col-sm-10">

            <blockquote style="padding: 2px 10px;text-align: left">
                <p>审核信息 <span class="label label-danger">固定审批流</span></p>
            </blockquote>
            <div  style="text-align: left">
                <a href="javascript:void(0)" data-toggle="popover"
                   data-content="
                   <p class='examine_title'>审批流程</p>
                   <?php if(is_array($examine_record) || $examine_record instanceof \think\Collection || $examine_record instanceof \think\Paginator): if( count($examine_record)==0 ) : echo "" ;else: foreach($examine_record as $key=>$examine_r): if($examine_r['status'] == 0): elseif($examine_r['status'] == 1): ?>
                    <div class='examine_box'>
                        <i class='fa fa-check-circle text-success newicon'></i>
                        <div class='xian'></div>
                        <p><span class='text-muted'><?php echo $examine_r['check_time']; ?></span></p>
                        <p>  <?php echo $examine_r['check_staff']['name']; ?> <span class='text-muted'>通过了此申请</span></p>
                        <?php if($examine_r['content']): ?><p class='examine_bg'>  <?php echo $examine_r['content']; ?></p><?php endif; ?>
                    </div>
                <?php elseif($examine_r['status'] == 2): ?>
                  <div class='examine_box'>
                        <i class='fa fa-window-close text-red newicon'></i>
                        <div class='xian'></div>
                        <p><span class='text-muted'><?php echo $examine_r['check_time']; ?></span></p>
                        <p>  <?php echo $examine_r['check_staff']['name']; ?> <span class='text-muted'>拒绝了此申请</span></p>
                        <?php if($examine_r['content']): ?><p class='examine_bg'>  <?php echo $examine_r['content']; ?></p><?php endif; ?>
                  </div>
                <?php else: ?>

                  <div class='examine_box'>
                        <i class='fa fa-window-close text-red newicon'></i>
                        <div class='xian'></div>
                        <p><span class='text-muted'><?php echo $examine_r['check_time']; ?></span></p>
                        <p>  <?php echo $examine_r['check_staff']['name']; ?> <span class='text-muted'>撤回了此申请</span></p>
                        <?php if($examine_r['content']): ?><p class='examine_bg'>  <?php echo $examine_r['content']; ?></p><?php endif; ?>
                  </div>
                <?php endif; endforeach; endif; else: echo "" ;endif; ?>" data-html="true">查看审批历史</a>
            </div>

            <div class="row rowbox" style="margin-left: 20px">
                <?php if(is_array($flow['stepList']) || $flow['stepList'] instanceof \think\Collection || $flow['stepList'] instanceof \think\Paginator): if( count($flow['stepList'])==0 ) : echo "" ;else: foreach($flow['stepList'] as $key=>$val): ?>
                <div class="stafflist"  data-container="body" data-toggle="popover" data-placement="bottom" data-content="<?php if(is_array($val['stafflist']) || $val['stafflist'] instanceof \think\Collection || $val['stafflist'] instanceof \think\Paginator): if( count($val['stafflist'])==0 ) : echo "" ;else: foreach($val['stafflist'] as $key=>$sf): if($sf['examine_reord']['status'] == 0): ?>
                <p><i class='fa fa-clock-o text-red'></i> <?php echo $sf['name']; ?> 待审核此申请</p>
                <?php elseif($sf['examine_reord']['status'] == 1): ?>
                <p><i class='fa fa-check-circle text-success'></i> <?php echo $sf['examine_reord']['check_time']; ?></p>
                <p><?php echo $sf['name']; ?> 通过此申请</p>
                <?php elseif($sf['examine_reord']['status'] == 2): ?>
                <p><i class='fa fa-window-close text-red'></i> <?php echo $sf['examine_reord']['check_time']; ?></p>
                <p><?php echo $sf['name']; ?> 拒绝此申请</p>
                <?php else: ?>
                <p><i class='fa fa-mail-reply text-red'></i> <?php echo $sf['name']; ?> 已撤销</p>
                <?php endif; endforeach; endif; else: echo "" ;endif; ?>" data-html="true">


                    <img src="/assets/addons/qingdongams/img/avatar.png" class="img-circle">
                    <?php if($val['status'] == 3): ?>
                    <span class="text-muted">发起人主管</span>
                    <?php elseif($val['status'] == 2): ?>
                    <span class="text-muted"><?php echo count($val['stafflist']); ?>人并签</span>
                    <?php else: ?>
                    <span class="text-muted"><?php echo count($val['stafflist']); ?>人或签</span>
                    <?php endif; if($val['order_id'] < $flow['order_id']): ?>
                    <p><span><i class="fa fa-check-circle text-success"></i> 审核通过</span></p>
                    <?php else: if($row['check_status'] == 3): ?>
                        <p> <span><i class="fa fa-window-close text-red"></i> 审核拒绝</span></p>
                        <?php else: ?>
                        <p><span><i class="fa fa-clock-o text-red"></i> 待审核</span></p>
                        <?php endif; endif; ?>

                </div>

                <div class="stafflist-right">
                    <i class="fa fa-angle-right" style="color: #ccc;margin: 0 16px;font-size: 20px;font-weight: 600;"></i>
                </div>

                <?php endforeach; endif; else: echo "" ;endif; ?>
            </div>


        </div>
    </div>

    <?php else: ?>

    <div class="div-flex">
        <div class="form-group col-sm-10">
        <blockquote style="padding: 2px 10px;text-align: left">
            <p>审核信息 <span class="label label-danger">发起人自选</span></p>
        </blockquote>
            <div  style="text-align: left">
                <a href="javascript:void(0)" data-toggle="popover"
                   data-content="
                   <p class='examine_title'>审批流程</p>
                   <?php if(is_array($examine_record) || $examine_record instanceof \think\Collection || $examine_record instanceof \think\Paginator): if( count($examine_record)==0 ) : echo "" ;else: foreach($examine_record as $key=>$examine_r): if($examine_r['status'] == 0): elseif($examine_r['status'] == 1): ?>
                    <div class='examine_box'>
                        <i class='fa fa-check-circle text-success newicon'></i>
                        <div class='xian'></div>
                        <p><span class='text-muted'><?php echo $examine_r['check_time']; ?></span></p>
                        <p>  <?php echo $examine_r['check_staff']['name']; ?> <span class='text-muted'>通过了此申请</span></p>
                        <?php if($examine_r['content']): ?><p class='examine_bg'>  <?php echo $examine_r['content']; ?></p><?php endif; ?>
                    </div>
                <?php elseif($examine_r['status'] == 2): ?>
                  <div class='examine_box'>
                        <i class='fa fa-window-close text-red newicon'></i>
                        <div class='xian'></div>
                        <p><span class='text-muted'><?php echo $examine_r['check_time']; ?></span></p>
                        <p>  <?php echo $examine_r['check_staff']['name']; ?> <span class='text-muted'>拒绝了此申请</span></p>
                        <?php if($examine_r['content']): ?><p class='examine_bg'>  <?php echo $examine_r['content']; ?></p><?php endif; ?>
                  </div>
                <?php else: ?>

                  <div class='examine_box'>
                        <i class='fa fa-window-close text-red newicon'></i>
                        <div class='xian'></div>
                        <p><span class='text-muted'><?php echo $examine_r['check_time']; ?></span></p>
                        <p>  <?php echo $examine_r['check_staff']['name']; ?> <span class='text-muted'>撤回了此申请</span></p>
                        <?php if($examine_r['content']): ?><p class='examine_bg'>  <?php echo $examine_r['content']; ?></p><?php endif; ?>
                  </div>
                <?php endif; endforeach; endif; else: echo "" ;endif; ?>" data-html="true">查看审批历史</a>
            </div>
        <div class="row rowbox" style="margin-left: 20px">

            <?php if(is_array($flow['stepList']['0']['stafflist']) || $flow['stepList']['0']['stafflist'] instanceof \think\Collection || $flow['stepList']['0']['stafflist'] instanceof \think\Paginator): if( count($flow['stepList']['0']['stafflist'])==0 ) : echo "" ;else: foreach($flow['stepList']['0']['stafflist'] as $key=>$val): ?>
            <div class="stafflist">
                <img src="<?php echo $val['img']; ?>" class="img-circle">
                <span class="text-muted"><?php echo $val['name']; ?></span>
                <?php if($val['examine_reord']['status'] == 0): ?>
                <p><span><i class="fa fa-clock-o text-red"></i> 待审核</span></p>
                <?php elseif($val['examine_reord']['status'] == 1): ?>
                <p><span><i class="fa fa-check-circle text-success"></i> 审核通过</span></p>
                <?php else: ?>
                <p> <span><i class="fa fa-window-close text-red"></i> 审核拒绝</span></p>
                <?php endif; ?>
            </div>

            <div class="stafflist-right">
                <i class="fa fa-angle-right" style="color: #ccc;margin: 0 16px;font-size: 20px;font-weight: 600;"></i>
            </div>

            <?php endforeach; endif; else: echo "" ;endif; ?>
        </div>
        </div>
    </div>
    <?php endif; endif; ?>
    <div class="div-flex" style="margin-top: 20px">
        <div class="form-group">
            <span class="text-muted">合同编号</span>
            <p><?php echo $row['num']; ?></p>
        </div>

        <div class="form-group">
            <span class="text-muted">客户名称</span>
            <p><?php if(isset($row['customer']['name'])): ?><?php echo $row['customer']['name']; endif; ?></p>
        </div>
        <div class="form-group">
            <span class="text-muted">商机名称</span>
            <p><?php if(isset($row['business']['name'])): ?><?php echo $row['business']['name']; endif; ?></p>
        </div>
        <div class="form-group">
            <span class="text-muted">合同金额（元）</span>
            <p><?php echo $row['money']; ?></p>
        </div>
        <div class="form-group">
            <span class="text-muted">回款金额</span>
            <p><?php echo $row['repayment_money']; ?></p>
        </div>
        <div class="form-group">
            <span class="text-muted">未回款金额</span>
            <p><?php echo $row['no_money']; ?></p>
        </div>
        <div class="form-group">
            <span class="text-muted">签约时间</span>
            <p><?php echo $row['order_date']; ?></p>
        </div>
        <div class="form-group">
            <span class="text-muted">负责人</span>
            <p><?php if(isset($row['owner_staff']['name'])): ?><?php echo $row['owner_staff']['name']; endif; ?></p>
        </div>
    </div>
    <div>

        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active"><a href="#record" aria-controls="home" role="tab" data-toggle="tab">跟进记录</a></li>
            <li role="presentation"><a href="#basic" aria-controls="profile" role="tab" data-toggle="tab">基本信息</a></li>
            <li role="presentation"><a href="#other" aria-controls="profile" role="tab" data-toggle="tab">其他信息</a></li>
            <li role="presentation"><a href="#product" aria-controls="profile" role="tab" data-toggle="tab">产品明细</a></li>

            <li role="presentation"><a href="#settings2" aria-controls="profile" role="tab" data-toggle="tab">回款信息</a></li>

            <li role="presentation"><a href="#settings4" aria-controls="settings" role="tab" data-toggle="tab">操作记录</a></li>
        </ul>

        <div class="tab-content" style="overflow-y: scroll;height:565px">
            <div role="tabpanel" class="tab-pane fade active in panel-body" id="record">

                <div id="toolbar_records" class="toolbar">
                    <?php echo build_toolbar('refresh'); ?>
                    <a class="btn btn-success btn-dialog <?php echo $auth->check('qingdongams/contract/record/add')?'':'hide'; ?>"
                       data-url="qingdongams/contract/record/add?ids=<?php echo $row['id']; ?>" data-title="新建跟进" data-refresh="true" data-area=["90%","90%"]>新建跟进</a>
                </div>
                <table id="records" class="table table-striped table-bordered table-hover table-nowrap"
                       width="100%">
                </table>
            </div>


            <div role="tabpanel" class="tab-pane fade panel-body" id="product">
                <div id="toolbar_product" class="toolbar">
                    <?php echo build_toolbar('refresh'); ?>
                </div>
                <table id="operation_product" class="table table-striped table-bordered table-hover table-nowrap"
                       width="100%">
                </table>


            </div>
			<div role="tabpanel" class="tab-pane fade panel-body form-horizontal" id="basic">


                <div class="form-group">
                    <?php if(is_array($form_data) || $form_data instanceof \think\Collection || $form_data instanceof \think\Paginator): if( count($form_data)==0 ) : echo "" ;else: foreach($form_data as $key=>$val): if($val['config']['is_delete'] == true || true): if($val['component'] == 'input'): ?>
		<div class="col-xs-6 col-sm-5">
			<div class="form-group col-sm-10">
				<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
				<?php echo $row[$val['id']]??''; ?>
			</div>
		</div>
	<?php endif; if($val['component'] == 'input-number'): ?>
		<div class="col-xs-6 col-sm-5">
			<div class="form-group col-sm-10">
				<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
				<?php echo $row[$val['id']]??''; ?>
			</div>
		</div>
	<?php endif; if($val['component'] == 'textarea'): ?>
	<div class="col-xs-12 col-sm-10">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo $row[$val['id']]??''; ?>
		</div>
	</div>
	<?php endif; if($val['component'] == 'radio'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo $row[$val['id']]??''; ?>

		</div>
	</div>
	<?php endif; if($val['component'] == 'checkbox'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo $row[$val['id']]??''; ?>
		</div>
	</div>
	<?php endif; if($val['component'] == 'Cascader'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo $row[$val['id']]??''; ?>
		</div>
	</div>
	<?php endif; if($val['component'] == 'select'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo $row[$val['id']]??''; ?>
		</div>
	</div>
	<?php endif; if($val['component'] == 'TimePicker'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo $row[$val['id']]??''; ?>
		</div>
	</div>
	<?php endif; if($val['component'] == 'DatePicker'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo $row[$val['id']]??''; ?>
		</div>
	</div>
	<?php endif; if($val['component'] == 'Rate'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo $row[$val['id']]??''; ?>
		</div>
	</div>
	<?php endif; if($val['component'] == 'uploadImage'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php if(isset($row[$val['id']]) && $row[$val['id']] != ''): if(is_array($row[$val['id']]) || $row[$val['id']] instanceof \think\Collection || $row[$val['id']] instanceof \think\Paginator): if( count($row[$val['id']])==0 ) : echo "" ;else: foreach($row[$val['id']] as $key=>$v): ?>
			<a href="<?php echo $v['file_path']??''; ?>" target="_blank" style="margin-right:10px;">
				<img  src="<?php echo $v['file_path']??''; ?>" data-tips-image width="100px" height="100px" alt="">
			</a>
			<?php endforeach; endif; else: echo "" ;endif; endif; ?>
		</div>
	</div>
	<?php endif; if($val['component'] == 'uploadFile'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php if(isset($row[$val['id']]) && $row[$val['id']] != ''): if(is_array($row[$val['id']]) || $row[$val['id']] instanceof \think\Collection || $row[$val['id']] instanceof \think\Paginator): if( count($row[$val['id']])==0 ) : echo "" ;else: foreach($row[$val['id']] as $key=>$v): ?>
			<a href="<?php echo $v['file_path']??''; ?>" target="_blank" style="margin-right:10px;">
				<?php echo $v['name']; ?>
			</a>
			<?php endforeach; endif; else: echo "" ;endif; endif; ?>
		</div>
	</div>
	<?php endif; ?>

	<!--金额-->
	<?php if($val['component'] == 'input-money'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo (isset($row[$val['id']]) && ($row[$val['id']] !== '')?$row[$val['id']]:''); ?>
		</div>
	</div>
	<?php endif; ?>
	<!--	手机号-->
	<?php if($val['component'] == 'input-mobile'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo (isset($row[$val['id']]) && ($row[$val['id']] !== '')?$row[$val['id']]:''); ?>
		</div>
	</div>
	<?php endif; ?>
	<!--邮箱-->
	<?php if($val['component'] == 'input-email'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo (isset($row[$val['id']]) && ($row[$val['id']] !== '')?$row[$val['id']]:''); ?>
		</div>
	</div>
	<?php endif; ?>
	<!--编辑器-->
	<?php if($val['component'] == 'editor'): ?>
	<div class="col-xs-12 col-sm-10">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo (isset($row[$val['id']]) && ($row[$val['id']] !== '')?$row[$val['id']]:''); ?>
		</div>
	</div>
	<?php endif; ?>
	<!--开关-->
	<?php if($val['component'] == 'switch'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<a href="javascript:;" data-toggle="switcher" disabled class="btn-switcher" data-input-id="c-<?php echo $val['id']; ?>" data-yes="1" data-no="0" >
				<?php if(isset($row[$val['id']])): if($row[$val['id']] == '0'): ?>
					<i class='fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x'></i>
					<?php else: ?>
					<i class='fa fa-toggle-on text-success fa-2x'></i>
					<?php endif; else: ?>
					<i class='fa fa-toggle-on text-success fa-flip-horizontal text-gray fa-2x'></i>
				<?php endif; ?>

			</a>
		</div>
	</div>
	<?php endif; ?>

	<!--地理位置-->
	<?php if($val['component'] == 'location'): ?>

	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo (isset($row[$val['id']]) && ($row[$val['id']] !== '')?$row[$val['id']]:''); ?>
			<a href="https://apis.map.qq.com/uri/v1/marker?marker=coord:<?php echo (isset($row[$val['id'].'_lat']) && ($row[$val['id'].'_lat'] !== '')?$row[$val['id'].'_lat']:''); ?>,<?php echo (isset($row[$val['id'].'_lng']) && ($row[$val['id'].'_lng'] !== '')?$row[$val['id'].'_lng']:''); ?>;title:<?php echo (isset($row['name']) && ($row['name'] !== '')?$row['name']:''); ?>;addr:<?php echo (isset($row[$val['id']]) && ($row[$val['id']] !== '')?$row[$val['id']]:''); ?>&referer=crm" target="_blank" ><i class="fa fa-map-marker text-blue" style="font-size: 18px;margin-right:4px"></i></a>
		</div>
	</div>

	<?php endif; ?>
	<!--地图-->
	<?php if($val['component'] == 'map'): ?>

	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php echo (isset($row[$val['id']]) && ($row[$val['id']] !== '')?$row[$val['id']]:''); ?>
			<a href="https://apis.map.qq.com/uri/v1/marker?marker=coord:<?php echo (isset($row[$val['id'].'_lat']) && ($row[$val['id'].'_lat'] !== '')?$row[$val['id'].'_lat']:''); ?>,<?php echo (isset($row[$val['id'].'_lng']) && ($row[$val['id'].'_lng'] !== '')?$row[$val['id'].'_lng']:''); ?>;title:<?php echo (isset($row['name']) && ($row['name'] !== '')?$row['name']:''); ?>;addr:<?php echo (isset($row[$val['id']]) && ($row[$val['id']] !== '')?$row[$val['id']]:''); ?>&referer=crm" target="_blank" ><i class="fa fa-map-marker text-blue" style="font-size: 18px;margin-right:4px"></i></a>
		</div>
	</div>
	<?php endif; ?>
	<!--关联客户-->
	<?php if($val['component'] == 'customer'): ?>

	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php if(isset($row[$val['id']]) && $row[$val['id']]): ?>
			<?php echo (isset($row[$val['id']]['name']) && ($row[$val['id']]['name'] !== '')?$row[$val['id']]['name']:''); endif; ?>
		</div>
	</div>
	<?php endif; ?>
	<!--关联联系人-->
	<?php if($val['component'] == 'contact'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php if(isset($row[$val['id']]) && $row[$val['id']]): ?>
			<?php echo (isset($row[$val['id']]['name']) && ($row[$val['id']]['name'] !== '')?$row[$val['id']]['name']:''); endif; ?>
		</div>
	</div>
	<?php endif; ?>
	<!--关联合同-->
	<?php if($val['component'] == 'contract'): ?>
	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php if(isset($row[$val['id']]) && $row[$val['id']]): ?>
			<?php echo (isset($row[$val['id']]['name']) && ($row[$val['id']]['name'] !== '')?$row[$val['id']]['name']:''); endif; ?>
		</div>
	</div>
	<?php endif; ?>
	<!--关联商机-->
	<?php if($val['component'] == 'business'): ?>

	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php if(isset($row[$val['id']]) && $row[$val['id']]): ?>
			<?php echo (isset($row[$val['id']]['name']) && ($row[$val['id']]['name'] !== '')?$row[$val['id']]['name']:''); endif; ?>
		</div>
	</div>
	<?php endif; ?>
	<!--关联员工-->
	<?php if($val['component'] == 'staff'): ?>

	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php if(isset($row[$val['id']]) && $row[$val['id']]): ?>
			<?php echo (isset($row[$val['id']]['name']) && ($row[$val['id']]['name'] !== '')?$row[$val['id']]['name']:''); endif; ?>
		</div>
	</div>
	<?php endif; ?>
	<!--关联部门-->
	<?php if($val['component'] == 'department'): ?>

	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php if(isset($row[$val['id']]) && $row[$val['id']]): ?>
			<?php echo (isset($row[$val['id']]['name']) && ($row[$val['id']]['name'] !== '')?$row[$val['id']]['name']:''); endif; ?>
		</div>
	</div>
	<?php endif; ?>
	<!--标签-->
	<?php if($val['component'] == 'label'): ?>

	<div class="col-xs-12 col-sm-5">
		<div class="form-group col-sm-10">
			<span class="text-muted"><?php echo $val['config']['label']; ?>:</span>
			<?php if(isset($row[$val['id']]) && $row[$val['id']]): $label_info=explode(',',$row[$val['id']]); if(is_array($label_info) || $label_info instanceof \think\Collection || $label_info instanceof \think\Paginator): if( count($label_info)==0 ) : echo "" ;else: foreach($label_info as $key=>$tem): $label_color=explode('^',$tem); if(isset($label_color[1])): ?>
				<div class="label" style="margin-left:5px;background: rgba(0, 82, 204, 0.1);color: <?php echo $label_color['1']; ?>"><?php echo $label_color['0']; ?></div>
				<?php endif; endforeach; endif; else: echo "" ;endif; endif; ?>
		</div>
	</div>
	<?php endif; endif; endforeach; endif; else: echo "" ;endif; ?>

                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">客户签约人:</span>
                            <span class="text-black"><?php echo $row['contacts']['name']; ?></span>
                        </div>
                    </div>

                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">公司签约人:</span>
                            <span class="text-black"><?php echo $row['order_staff']['name']; ?></span>
                        </div>
                    </div>
                    <?php if($row['ratios'] != null): ?>
                    <div class="col-xs-12 col-sm-10">

                        <div class="form-group col-sm-10">
                            <blockquote style="padding: 2px 10px;">
                                <div class="form-inline">
                                    <label>业绩分成：<?php if(empty($row['ratios']) || (($row['ratios'] instanceof \think\Collection || $row['ratios'] instanceof \think\Paginator ) && $row['ratios']->isEmpty())): ?>（无）<?php endif; ?></label>
                                </div>
                            </blockquote>

                            <table class="table " style="width: 300px;<?php if(empty($row['ratios']) || (($row['ratios'] instanceof \think\Collection || $row['ratios'] instanceof \think\Paginator ) && $row['ratios']->isEmpty())): ?>display: none<?php endif; ?>">
                                <thead>
                                <tr>
                                    <th width="80">比例</th>
                                    <th>团队成员</th>
                                    <th>业绩</th>
                                </tr>
                                </thead>
                                <tbody>
                                    <?php if(is_array($row['ratios']) || $row['ratios'] instanceof \think\Collection || $row['ratios'] instanceof \think\Paginator): if( count($row['ratios'])==0 ) : echo "" ;else: foreach($row['ratios'] as $key=>$val): ?>
                                        <tr>
                                            <td><?php echo $val['ratio']; ?>%</td>
                                            <td><?php echo $val['staff']['name']; ?></td>
                                            <td>￥<?php echo $val['money']; ?></td>
                                        </tr>
                                    <?php endforeach; endif; else: echo "" ;endif; ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <?php endif; ?>

                </div>


			</div>
            <div role="tabpanel" class="tab-pane fade panel-body form-horizontal" id="other">
                <div class="form-group">
                    <div class="alert alert-warning-light no-margin">
                        客户收货人信息
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-xs-12 col-sm-12">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">收货人:</span>
                            <span class="text-black"><?php echo $row['consignee']; ?></span>
                        </div>
                    </div>
                    <div class="col-xs-12 col-sm-12">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">联系方式:</span>
                            <span class="text-black"><?php echo $row['consignee_mobile']; ?></span>
                        </div>
                    </div>
                    <div class="col-xs-12 col-sm-12">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">详细地址:</span>
                            <span class="text-black"><?php echo $row['delivery_address']; ?><?php echo $row['delivery_address_detail']; ?></span>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <div class="alert alert-warning-light no-margin">
                        发票物流信息
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-xs-12 col-sm-12">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">物流单号:</span>
                            <span class="text-black"><?php echo $row['invoice_logistics_number']; ?></span>
                        </div>
                    </div>
                    <div class="col-xs-12 col-sm-12">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">发货时间:</span>
                            <span class="text-black"><?php echo $row['invoice_date']; ?></span>
                        </div>
                    </div>
                    <div class="col-xs-12 col-sm-12">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">发货凭证:</span>
                            <div class="well">
                                <?php if($row['invoice_file_ids']): ?>
                                <div class="thumbnail">
                                    <?php if(is_array($row['invoice_file_ids']) || $row['invoice_file_ids'] instanceof \think\Collection || $row['invoice_file_ids'] instanceof \think\Paginator): if( count($row['invoice_file_ids'])==0 ) : echo "" ;else: foreach($row['invoice_file_ids'] as $key=>$val): ?>
                                    <img data-tips-image src="<?php echo $val; ?>" alt="">
                                    <?php endforeach; endif; else: echo "" ;endif; ?>
                                </div>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <div class="alert alert-warning-light no-margin">
                        回执单信息
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-xs-12 col-sm-12">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">回执信息:</span>
                            <span class="text-black"><?php echo $row['receipt_date']; ?></span>
                        </div>
                    </div>
                    <div class="col-xs-12 col-sm-12">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">回执凭证:</span>
                            <div class="well">
                                <?php if($row['receipt_file_ids']): ?>
                                <div class="thumbnail">
                                    <?php if(is_array($row['receipt_file_ids']) || $row['receipt_file_ids'] instanceof \think\Collection || $row['receipt_file_ids'] instanceof \think\Paginator): if( count($row['receipt_file_ids'])==0 ) : echo "" ;else: foreach($row['receipt_file_ids'] as $key=>$val): ?>
                                    <img data-tips-image src="<?php echo $val; ?>" alt="">
                                    <?php endforeach; endif; else: echo "" ;endif; ?>
                                </div>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
            <div role="tabpanel" class="tab-pane fade panel-body" id="settings2">
                <div class="panel panel-warning">
                    <div class="panel-heading">回款计划</div>
                    <div class="panel-body">
                        <div id="toolbar_receivablesplan" class="toolbar">
                            <?php echo build_toolbar('refresh'); ?>
                            <a class="btn btn-success btn-dialog <?php echo $auth->check('qingdongams/customer/receivablesplan/add')?'':'hide'; ?>" data-url="qingdongams/customer/receivablesplan/add?customer_id=<?php echo $row['customer_id']; ?>&contract_id=<?php echo $row['id']; ?>" data-title="新建回款计划" data-refresh="true"  >新建回款计划</a>
                        </div>
                        <table id="plan" class="table table-striped table-bordered table-hover table-nowrap"
                               width="100%">
                        </table>
                    </div>
                </div>

                <div class="panel panel-info">
                    <div class="panel-heading">回款记录</div>
                    <div class="panel-body">
                        <div id="toolbar_receivables" class="toolbar">
                            <?php echo build_toolbar('refresh'); ?>
                            <a class="btn btn-success btn-dialog <?php echo $auth->check('qingdongams/customer/receivables/add')?'':'hide'; ?>"  data-refresh="true" data-url="qingdongams/customer/receivables/add?customer_id=<?php echo $row['customer_id']; ?>&contract_id=<?php echo $row['id']; ?>" data-area=["90%","90%"] data-title="新建回款">新建回款</a>
                        </div>
                        <table id="receivables" class="table table-striped table-bordered table-hover table-nowrap"
                               width="100%">
                        </table>
                    </div>
                </div>

            </div>

            <div role="tabpanel" class="tab-pane fade panel-body" id="settings3">
                <div id="toolbar_files" class="toolbar">
                    <?php echo build_toolbar('refresh'); ?>
                </div>
                <table id="files" class="table table-striped table-bordered table-hover table-nowrap"
                       width="100%">
                </table>
            </div>
            <div role="tabpanel" class="tab-pane fade panel-body" id="settings4">
                <div id="toolbar_log" class="toolbar">
                    <?php echo build_toolbar('refresh'); ?>
                </div>
                <table id="operation_log" class="table table-striped table-bordered table-hover table-nowrap"
                       width="100%">
                </table>


            </div>
        </div>

    </div>
</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="/assets/js/require.min.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version'] ?? ''); ?>"></script>

    </body>
</html>
